import axios from '@/api/interceptor';
import type { TableData } from '@arco-design/web-vue/es/table/interface';

export interface ContentDataRecord {
  x: string;
  y: number;
}

export const queryContentData = async () => {
  const result = await axios.get<ContentDataRecord[]>('/api/content-data');
  return result.data;
};

export interface PopularRecord {
  key: number;
  clickNumber: string;
  title: string;
  increases: number;
}

export const queryPopularList = async (params: { type: string }) => {
  const result = await axios.get<TableData[]>('/api/popular/list', { params });
  return result.data;
};
